package com.bjtech.dao.ibatis;

import java.util.List;
import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

import com.bjtech.dao.UtilDao;
import com.bjtech.domain.UserInfo;
@Repository(value="utilDao")
public class SqlMapUtilDao extends SqlMapClientDaoSupport implements UtilDao {

	public UserInfo getUserInfoByUserName(String username) {
		return (UserInfo)super.getSqlMapClientTemplate().queryForObject("selectUserInfoByUserName", username);
	}
	
	public List selectReport(String reportName, Map map){
		if (reportName == null || reportName.length() == 0)
			return null;
		return super.getSqlMapClientTemplate().queryForList(reportName, map);
	}

	public int updateSelectReadCount() {
		return (Integer) super.getSqlMapClientTemplate().queryForObject("selectReadCount");
	}

	public void updateCount() {
		 super.getSqlMapClientTemplate().update("updateReadCountsCount");
	}
}